.SUFFIXES: .c .o .lo

COMPILE = $(CC) $(CFLAGS)
INC_PATH = -I.. -I../common -I../../include
LIB_PATH = $(LIBS) -lfdirclient -lfastcommon -lserverframe -lfcfsauthclient -lfcfsvoteclient
TARGET_PATH = $(TARGET_PREFIX)/bin

STATIC_OBJS = ../common/auth_global.o ../common/auth_proto.o   \
              ../common/auth_func.o ../common/server_session.o \
              db/dao/dao.o db/dao/func.o db/dao/user.o \
              db/dao/storage_pool.o db/dao/granted_pool.o \
              db/auth_db.o db/pool_usage_updater.o server_global.o \
              server_func.o common_handler.o service_handler.o \
              cluster_handler.o session_subscribe.o cluster_relationship.o \
              cluster_info.o

ALL_PRGS = fcfs_authd

all: $(STATIC_OBJS) $(ALL_PRGS)

$(ALL_PRGS): $(STATIC_OBJS)

.o:
	$(COMPILE) -o $@ $<  $(STATIC_OBJS) $(LIB_PATH) $(INC_PATH)
.c:
	$(COMPILE) -o $@ $<  $(STATIC_OBJS) $(LIB_PATH) $(INC_PATH)
.c.o:
	$(COMPILE) -c -o $@ $<  $(INC_PATH)

install:
	mkdir -p $(TARGET_PATH)
	cp -f $(ALL_PRGS) $(TARGET_PATH)

clean:
	rm -f $(STATIC_OBJS) $(ALL_PRGS)
